{extend name="public/base" /}

{block name="title"}<title>编辑</title>{/block}

{block name="pjax_container"}
<section class="content-header">
    <h1>用户信息</h1>
    <ol class="breadcrumb">
        <li class="active"><i class="fa fa-dashboard"></i> 用户信息</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <form class="form-horizontal" method="POST" action="{:url('edit')}" onsubmit="return false">
                <input type="hidden" name="id" value="{$info.id|default=0}" />
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a href="#tab1" data-toggle="tab">用户信息</a>
                        </li>
                        <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="tab-pane active" id="tab1">

                            <div class="form-group">
                                <label class="col-sm-2 control-label">用户编号</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.number}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">昵称</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.nickname|default=''}" placeholder="昵称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">姓名</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.name|default=''}" placeholder="姓名">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">手机号</label>
                                <div class="col-sm-7">
                                    <input class="form-control"  disabled="disabled" value="{$info.mobile|default=''}" placeholder="手机号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">头像</label>
                                <div class="col-sm-7">
                                    <a href="{$info['avatar']|default=''}" target="_blank"><img src="{$info['avatar']|default=''}" width="40" height="40"></a>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">出生日期</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.BirthdayStr|default=''}" placeholder="出生日期">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">性别</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.SexStr|default=''}" placeholder="性别">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">积分</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.points|default=''}" placeholder="积分">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">第一次称体重 单位（斤）</label>
                                <div class="col-sm-7">
                                    <input class="form-control" name="first_weight" value="{$info.FirstWeightStr}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">当前测试体重（斤）</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.LastWeightStr}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">称重记录</label>
                                <div class="col-sm-7" style="padding-top:7px;">
                                    {if condition="$info.first_weight > 0"}
                                        <a data-toggle="modal" href="{:url('user_weight_log_echarts', ['id'=>$info.id])}" data-target="#modal">查看图表</a>
                                    {else/}
                                        暂无记录
                                    {/if}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">开盘通知</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.NoteStr}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">是否核销</label>
                                <div class="col-sm-7">
                                    <input class="form-control" disabled="disabled" value="{$info.IsVerificationStr}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">推荐人</label>
                                <div class="col-sm-7" style="margin-top:7px;">
                                    {if condition="$info.PIdStr['id'] > 0"}
                                        <a target="_blank" href="{:url('client_user/edit', ['id'=>$info.PIdStr['id']])}" data-target="#modal">{$info.PIdStr['nickname']}</a>
                                    {else/}
                                        {$info.PIdStr['nickname']}
                                    {/if}
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">状态</label>
                                <div class="col-sm-7">
                                    <select class="form-control select2" name="status" style="width:100%;">
                                        {volist name="user_status" id="vo"}
                                            <option value="{$key}"{if condition="isset($info['status']) && $info['status']==$key"}selected="selected"{/if}>{$vo}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="box-footer">
                        <div class="col-sm-2"></div>
                        <div class="col-sm-7">
                            <div class="btn-group pull-right">
                                <button type="submit" class="btn btn-info pull-right submits" data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt; 提交">提交</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</section>
<div id="modal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document" style="width:900px !important;height:590px !important;">
        <div class="modal-content" style="width:900px !important;height:590px !important;"></div>
    </div>
</div>
<script type="text/javascript">
    $("#modal").on("hidden.bs.modal", function() {
        $(this).removeData("bs.modal");
    });
$(function(){
    /*ajax页面加载icheck，有该控件的页面才需要*/
    $(".select2").select2({language:"zh-CN"});
});
</script>
{/block}
